type EvnInfoType = {
  NODE_ENV: 'development' | 'release' | 'production'
  VUE_APP_PLATFORM: string
}

const evnInfo: EvnInfoType = process.env
const platform: 'android' | 'ios' | 'devtools' | string =
  uni.getSystemInfoSync().platform
console.log(process.env, uni.getSystemInfoSync())
// 默认参数
const params = {
  ...evnInfo,
  platform: platform,
  valKey: 'value', //数据字典的value key
  labelKey: 'name', //数据字典的 展示 keyß
  pageSizeKey: 'pageSize', //一页几条
  pageNumKey: 'page', //请求数据当前页码
  totalKey: 'count', //接口返回的总条数
  pageListKey: 'list', //接口返回的数据列表
  mainColor: '#4CCFDC', //主题色
  storePrefix: 'OXYGEN_',
  ossUrl: 'https://public-oss-file.zmaxfilm.com/applet/img/film-oxygen-uniapp',

  // 默认城市定位地址
  areaInfo: {
    cityId: '350100',
    initials: 'F',
    regionName: '福州市'
    // areaName: '台江区',
    // lat: 26.066419, // 纬度
    // lng: 119.29753 // 经度
  },
  cinemaInfo: { cinemaId: '2', cinemaName: '开发写死', cityId: '350001' },
  addressComponent: {
    city: '福州市',
    cityCode: '350100',
    direction: '附近',
    distance: '1-0',
    district: '台江区',
    districtCode: '350103',
    province: '福建省',
    provinceCode: '350000',
    street: '台江路',
    streetNumber: '88号',
    street_number: '88号'
  },
  formatted_address: '福建省福州市台江区台江路88号',
  mapKey: 'e5ff4f7be44f68ee62845a67f6f17a41', // 高德地图key
  BMapKey: 'sy7dPpWPgUe4YH7DFH6g2RynEWchCE3K', // 百度地图
  mapType: 'gd'
}
const config = {
  development: {
    host:
      evnInfo.VUE_APP_PLATFORM === 'h5'
        ? ''
        : 'https://zmax-test-mapi.zmaxfilm.com',
    webView: '',
    account: 'wwwcs_wxf',
    password: 'F72059979A64581D',
    deviceType: '',
    ttAppId: 'tt611617abfe29931601',
    miniAppId: 'wxe915dce2b679ea48',
    alipayMiniAppId: '2021003161685024'
  },
  release: {
    host: '/firemapi',
    webView: '',
    account: '',
    password: '',
    deviceType: '',
    ttAppId: 'tt611617abfe29931601',
    miniAppId: 'wxe915dce2b679ea48',
    alipayMiniAppId: '2021003161685024'
  },
  production: {
    // host: 'https://saas.zmaxfilm.com/api',
    // webView: '',
    // account: 'zzb1_cs',
    // password: '123456',
    // deviceType: '',
    // ttAppId: 'tt611617abfe29931601',
    // miniAppId: 'wxe915dce2b679ea48',
    // alipayMiniAppId: '2021003161685024'

    // host: '/api', //测试版本的正式环境
    host: 'https://saas.zmaxfilm.com/api', //完整路径无拼接
    webView: '',
    account: 'zryx_zr',
    password: '302A1F7051C01E28',
    deviceType: '',
    ttAppId: 'tt611617abfe29931601',
    miniAppId: 'wxe915dce2b679ea48',
    alipayMiniAppId: '2021003161685024'
  }
}

const data = { ...config[evnInfo.NODE_ENV], ...params }

export default data
